<template>
  <el-header class="header">
    <div class="header-container">
      <div class="logo">
        <router-link to="/">
          <el-image src="/chihiro005.jpg" fit="cover" class="logo-image" />
          <span class="logo-text">分型生成</span>
        </router-link>
      </div>
      
      <el-menu
        mode="horizontal"
        :router="true"
        class="nav-menu"
        :ellipsis="false"
        background-color="transparent"
        text-color="#fff"
        active-text-color="#409EFF"
      >
        <el-menu-item index="/">首页</el-menu-item>
        <el-menu-item index="/image-gallery">图片展示</el-menu-item>
        <el-menu-item index="/hanzi-generation">汉字生成</el-menu-item>
        <el-menu-item index="/text2img">文本生成图像</el-menu-item>
        <el-menu-item index="/img2img">图像生成图像</el-menu-item>
      </el-menu>

      <div class="header-right">
        <router-link to="/login">
          <el-button type="primary">
            <el-icon><User /></el-icon>
            登录
          </el-button>
        </router-link>
        <router-link to="/register" style="margin-left: 10px;">
          <el-button>
            注册
          </el-button>
        </router-link>
      </div>
    </div>
  </el-header>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { User } from '@element-plus/icons-vue'
// import { ElMessage } from 'element-plus'

// const loginDialogVisible = ref(false)
// const loginForm = ref({
//   username: '',
//   password: ''
// })

// const showLoginDialog = () => {
//   loginDialogVisible.value = true
// }

// const handleLogin = () => {
//   // 这里添加登录逻辑
//   ElMessage.success('登录成功')
//   loginDialogVisible.value = false
// }

// TODO: 如果后续需要用户状态管理，可以在这里添加相关逻辑

</script>

<style scoped>
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  height: 100px;
  padding: 0;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;

}

.logo {
  display: flex;
  align-items: center;
}

.logo a {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #fff;
}

.logo-image {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  margin-right: 10px;
}

.logo-text {
  font-size: 20px;
  font-weight: bold;
  color: #fff;
}

.nav-menu {
  border: none;
  background: transparent !important;
}

.nav-menu :deep(.el-menu-item) {
  font-size: 16px;
  height: 80px;
  line-height: 80px;
}

.nav-menu :deep(.el-menu-item.is-active) {
  font-weight: bold;
}

.header-right {
  display: flex;
  align-items: center;
}

.header-right .el-button {
  background: transparent;
  border: 1px solid #409EFF;
  color: #409EFF;
}

.header-right .el-button:hover {
  background: #409EFF;
  color: #fff;
}

/* 移除对话框相关的样式 */
/*
:deep(.el-dialog) {
  border-radius: 8px;
}

:deep(.el-dialog__header) {
  margin: 0;
  padding: 20px;
  border-bottom: 1px solid #eee;
}

:deep(.el-dialog__body) {
  padding: 30px 20px;
}

:deep(.el-dialog__footer) {
  padding: 20px;
  border-top: 1px solid #eee;
}
*/
</style> 